<%
sql="select * from book where bookid="&id&" order by INFO_ID desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write""
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage
<%showpage totalput,MaxPerPage,"contact_edit.asp"%> |
<%do while not rs.eof%>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
set rs=nothing
%>
<%showpage totalput,MaxPerPage,"contact_edit.asp"%> |
|
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write " | "
response.write ""
response.write "【最前页】【上一页】"
else
response.write "共"&n&"页 第"&CurrentPage&"页 "
response.write "共有"&totalnumber&"条反馈信息"
response.write "【最前页】"
response.write "【上一页】"
end if
if n-currentpage<1 then
response.write "【下一页】【最后页】"
else
response.write "【"
response.write "下一页】【 最后页】"
end if
response.write ""
end function
%> |